package com.da.javatest.niuke.baodian;

/**
 * @author chenlida
 * @date 2020/10/17 15:44
 * https://www.nowcoder.com/practice/e7e0d226f1e84ba7ab8b28efc6e1aebc?tpId=8&tags=&title=&diffculty=0&judgeStatus=0&rp=1
 */
public class C72UnusualAdd {
    public static int addAB(int A, int B) {
        while (B != 0) {
            int temp = A ^ B;
            B = (A & B) << 1;
            A = temp;
        }
        return A;
    }

    public static void main(String[] args) {
        System.out.println(addAB(4, 5));
    }
}
